@extends('admin.layout.common')
@section('content')
    <link rel="stylesheet" href="{{asset('/css/app.css')}}">
    <link rel="stylesheet" type="text/css" href="{{URL::asset('css/user/StatisticalControl.css')}}">
    <style>
        .error{
           color:red;
           position: absolute;
       }
    </style>
    <div class="content_box">
        <div class="content">
            <div class="mon">
                <div class="mon_left">
                    <p>
                        <i class="iconfont icon gongzuo">&#xe647;</i>
                        <span>{{date('Y年m月d日')}}  本月已开户{{ session('monthPass') }}个  打回{{session('monthRefuse')}}个</span>
                    <p>超过了{{ session('monthPrecent') }}的三咖审核员，继续努力！从此踏上人生巅峰，迎娶白富美！</p>
                    </p>
                </div>
                <div class="mon_right">
                    <p>您今天已经开户{{session('todayPass')}}个    打回{{session('todayRefuse')}}个</p>
                    <p>超过了{{session('todayPrecent')}}的三咖开户员哦~棒棒哒！！！</p>
                </div>
            </div>
            <p class="tongzhi"><i class="iconfont icon laba">&#xe914;</i>{{getArticleByDepartmentId()}}</p>
            <!-- 公共结束 -->
        </div>
        <div class="detailed">
            <form method="get" class="cmxform" id="signupForm"  action="">
                {{csrf_field()}}
                <label for="cname">用户姓名：
                    <input id="cname" type="text" name="real_name" placeholder="请输入姓名">
                </label>
                <label for="phone">用户手机号：
                    <input id="phone" type="text" name="phone" placeholder="请输入手机号">
                </label>
                <label for="stage_name">用户艺名:
                    <input id="stage_name" type="text" name="stage_name" placeholder="请输入艺名">
                </label>
                <label for="create_at">签约日期:
                    <input id="create_at" type="date" name="signed_time">
                </label>
                <label for="expired">
                    <input id="expired" type="radio" name="expired" class="radio_input" value="1">签约已到期
                </label>
                <label for="expired">
                    <input id="expired" type="radio" name="expired2" class="radio_input" value="2">签约3个月内到期
                </label>
                <label for="">
                    <input class="submit seek" type="submit" value="精确查找">
                </label><br/>
                <label for="">地区：
                    <select name="country">
                        <option value="">--请选择--</option>
                        <option value="中国">中国</option>
                        <option value="港澳台">港澳台</option>
                        <option value="日本">日本</option>
                        <option value="美国">美国</option>
                        <option value="其他">其他</option>
                    </select>
                </label>
                <label for="">性质：
                    <select name="type">
                        <option value="">--请选择--</option>
                        <option value="1">音乐人</option>
                        <option value="2">乐团团体</option>
                        <option value="3">经纪人</option>
                        <option value="4">唱片公司/厂牌</option>
                    </select>
                </label>
                <label for="">审核人：
                    <select name="check_man">
                        <option value="">--请选择--</option>
                        @foreach($check_man as $v)
                            <option value="{{$v['check_man']}}">{{$v['check_man']}}</option>
                        @endforeach
                    </select>
                </label>
                <label for="">用户来源：
                    <select name="come_from">
                        <option value="">--请选择--</option>
                        @foreach($come_from as $v)
                            <option value="{{$v['come_from']}}">{{$v['come_from']}}</option>
                        @endforeach
                    </select>
                </label>
                <label for="">状态：
                    <select name="status">
                        2已审核 ，3暂时停用，4打回
                        <option value="">--请选择--</option>
                        <option value="2">已审核</option>
                        <option value="3">暂时停用</option>
                        <option value="4">打回</option>
                        <option value="5">注销</option>
                    </select>
                </label>
            </form>
            <table border="1">
                <tr>
                    <th>ID</th>
                    <th>用户姓名</th>
                    <th>用户艺名</th>
                    <th>性质</th>
                    <th style="width:200px;" >签约时间</th>
                    <th style="width:200px;" >到期时间</th>
                    <th>审核人</th>
                    <th>手机号码</th>
                    {{--<th>邮箱</th>--}}
                    <th>所在地区</th>
                    <th>省份</th>
                    <th>用户作品数</th>
                    {{--<th>累计收入</th>--}}
                    <th>用户状态</th>
                    <th>用户来源</th>
                    {{--<th>代理</th>--}}
                </tr>
                @foreach($list as $v)
                    <tr>
                        <td class="dianji">{{$v['id']}}</td>
                        <td class="dianji"><a href="{{url('admin/userInfo', ['id' => $v['id']])}}">{{$v['real_name']}}</a></td>
                        <td class="dianji">{{$v['stage_name']}}</td>
                        <td class="dianji">{{$v['type_text']}}</td>
                        <td  style="width:200px;" class="dianji">{{$v['signed_time']}}</td>
                        <td  style="width:200px;" class="dianji">{{$v['expired_time']}}</td>
                        <td class="dianji">{{$v['check_man']}}</td>
                        <td class="dianji">{{$v['phone']}}</td>
                        {{--<td class="dianji"><a href="{{url('admin/userInfo', ['id' => $v['id']])}}">{{$v['email']}}</a></td>--}}
                        <td class="dianji">{{$v['country']}}</td>
                        <td class="dianji">{{$v['provice']}}</td>
                        <td class="dianji">{{$v['music_count']}}</td>
                        {{--<td class="dianji"><a href="{{url('admin/userInfo', ['id' => $v['id']])}}">1584.241</a></td>--}}
                        <td class="dianji">{{$v['status']}}</td>
                        <td class="dianji">{{$v['come_from']}}</td>
                        {{--<td class="dianji">@if($v['software_id']!='') 是 @else 否 @endif</td>--}}
                    </tr>
                @endforeach
            </table>
            <footer class="bottom">
                {{--<p style="float:left">共5278位用户，到期待签约43位，即将到期126位用户</p>--}}
                <style>
                    .pagination{float:right;margin-right:20px}
                </style>
                {{$list->appends([
                    'real_name' => $_GET['real_name'] ?? '',
                    'phone' => $_GET['phone'] ?? '',
                    'stage_name' => $_GET['stage_name'] ?? '',
                    'phone_name' => $_GET['phone_name'] ?? '',
                    'signed_time' => $_GET['signed_time'] ?? '',
                    'expired' => $_GET['expired'] ?? '',
                    'expired2' => $_GET['expired'] ?? '',
                    'country' => $_GET['country'] ?? '',
                    'type' => $_GET['type'] ?? '',
                    'check_man' => $_GET['check_man'] ?? '',
                    'come_from' => $_GET['come_from'] ?? '',
                ])->links()}}
            </footer>
        </div>
    </div>
    </div>
    @endsection
<script>
        function exit($id) {
            //表单验证
            $.validator.setDefaults({
                submitHandler: function() {
                    alert("提交事件!");
                }
            });
            $(function() {
// 在键盘按下并释放及提交后验证提交表单
                $("#signupForm").validate({
                    rules: {
                    },
                    messages: {
                        username: {
                            required: "请输入用户名",
                            minlength: "用户名必需由两个字母组成"
                        },
                        stage_name: {
                            required: "请输入艺名",
                            minlength: "用户名必需由两个字母组成"
                        },
                        email: "请输入一个正确的邮箱"
                    }
                });
            });
            // 弹窗
            layer.open({
                type: 2,
                area: ['500px', '300px'],
                content: 'http://{{$_SERVER['HTTP_HOST']}}/admin/changeManagerStatus/0'
                , btn: ['确定', '取消']
                , yes: function (index, layero) {
                    $.get('http://{{$_SERVER['HTTP_HOST']}}/admin/changeManagerStatus/' + $id, function (data) {
                        location.reload();
                    })
                }
            })
        }
</script>

